package thread03;

/**
 * Thread类中常用的方法:
 *      public static native Thread currentThread():
 *          获取当前线程对象
 *          Thread.currentThread()代码在哪一个线程被执行获取的就是哪一个线程对象
 *      public final String getName():获当前线程对象的名称
 *      public static void sleep(long millis) throws InterruptedException:让线程睡眠指定的毫秒值
 */
public class ThreadDemo03 {
    public static void main(String[] args) {
        Thread01 t1 = new Thread01();
        t1.start();

        for (int i = 0; i < 10; i++) {
            //Thread.currentThread()获取主线程的默认昵称
            System.out.println(Thread.currentThread().getName() + "..." + i);
        }

    }
}
